package com.ft.turorial.spring.boot.controller;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.ft.turorial.spring.boot.security.oauth2.domain.OAuth2Client;
import com.ft.turorial.spring.boot.security.oauth2.service.OAuth2ClientService;

@Controller
@RequestMapping("security/oauth2")
public class OAuth2ClientController {
	@Resource
	private OAuth2ClientService oAuthService;
	
	@RequestMapping("list")
	public String oAuth2ClientList(Model model){
		List<OAuth2Client> clients = oAuthService.findAll();
		System.out.println("****** "+clients.size());
		model.addAttribute("clients", clients);
		return "security/oauth2/client_list";
	}
}
